
import 'package:p_location/map/obj/icon_info.dart';

class IconDictionaryRes {
    List<IconInfo> data;
    int code;
    String detailMessage;
    String errMsg;
    String extra;
    int length;
    String msg;

    IconDictionaryRes({this.data, this.code, this.detailMessage, this.errMsg, this.extra, this.length, this.msg});

    factory IconDictionaryRes.fromJson(Map<String, dynamic> json) {
        return IconDictionaryRes(
            data: json['data'] != null ? (json['data'] as List).map((i) => IconInfo.fromJson(i)).toList() : null,
            code: json['code'], 
            detailMessage: json['detailMessage'],
            errMsg: json['errMsg'], 
            extra: json['extra'],
            length: json['length'], 
            msg: json['msg'], 
        );
    }

    Map<String, dynamic> toJson() {
        final Map<String, dynamic> data = new Map<String, dynamic>();
        data['code'] = this.code;
        data['errMsg'] = this.errMsg;
        data['length'] = this.length;
        data['msg'] = this.msg;
        if (this.data != null) {
            data['data'] = this.data.map((v) => v.toJson()).toList();
        }
        if (this.detailMessage != null) {
            data['detailMessage'] = this.detailMessage;
        }
        if (this.extra != null) {
            data['extra'] = this.extra;
        }
        return data;
    }
}